#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int target = 24;

// sum表示每一次dfs计算后的结果
bool bfs(vector<int> &nums, int depth, int sum)
{
  // base case 递归树到叶子节点了
  if (depth == nums.size() - 1)
  {
    if (sum == target)
    {
      return true;
    }
    return false;
  }

  // 做选择
  for (int i = depth; i < nums.size(); i++)
  {

    if (bfs(nums, depth + 1, sum + nums[i]) || bfs(nums, depth + 1, sum - nums[i]) ||
        bfs(nums, depth + 1, sum * nums[i]) || bfs(nums, depth + 1, sum / nums[i]))
    {
      return true;
    }
  }
  return false;
}

int main()
{
  //int a,b,c,d;
  vector<int> nums(4, 0);
  while (cin >> nums[0] >> nums[1] >> nums[2] >> nums[3])
  {
    // 最开始，递归start=0, 还没有计算dfs，所以计算结果sum=0
    if (bfs(nums, 0, 0))
    {
      cout << "true" << endl;
    }
    else
    {
      cout << "false" << endl;
    }
  }
  return 0;
}